package com.controller;

import com.service.ConsoleService;
import com.vo.ConsoleVo;
import com.vo.ResultVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping ("console")
@ResponseBody
public class ConsoleController {
    
    @Resource
    ConsoleService service;
    
    @RequestMapping(value = "" , method = RequestMethod.GET)
    public ResultVo<ConsoleVo> all(){
        ConsoleVo vo = new ConsoleVo();
        vo.setInventory_Up(service.inventoryDay());
        vo.setInventory_Size(service.inventorySize());
        vo.setSales_Day(service.salesDay());
        vo.setSales_Size(service.salesSize());
        vo.setOut_Day(service.outDay());
        vo.setOut_Size(service.outSize());
        vo.setInp_Day(service.inpDay());
        vo.setInp_Size(service.inpSize());
        vo.setDelivery_Day(service.deliveryDay());
        vo.setDelivery_Size(service.deliverySize());
        return new ResultVo<>(vo);
    }
    
}
